<template>
  <div class="head">

    <div class="desc-warp">
      <div class="headImg"
           style="back">
        <!-- <img src="https://s.moimg.net/new/images/headPic.png" alt=""> -->
        <img :src="getHead">
      </div>
      <div class="user-desc">

        <h2 class="userNamme"> {{ getUserData.nickname || '' }} </h2>
        <div class="userFans">
          <span class="rBoder">粉丝：0 </span>
          <span class="rBoder">关注：0 </span>
          <span>余额：{{ getUserData.money || 0 }} </span>
        </div>
        <div class="edit" @click="edit">
          <i class="iconfont icon-1"></i>
          编辑
        
        </div>
      </div>
    </div>
    <div class="desc-bg"
         :style="get_bg">
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { default_head } from '@/common/config.js'
export default {
  computed: {
    ...mapGetters(['getUserData']),
    getHead() {
      if (!this.getUserData || !this.getUserData.head ) {
        return default_head
      }
      return this.getUserData.head 
    },
    get_bg() {
      return `background: url('${this.getHead}')
    no-repeat;`
    }
  },
  methods:{
    edit(){
      this.$router.push('/front/user/editInfo')
    }
  }
}
</script>

<style scoped>
.head {
  height: 140px;
  background: #f6f6f6;
  display: flex;
  overflow: hidden;
  position: relative;
}
.headImg {
  height: 120px;
  width: 120px;
  padding: 20px;
}
.desc-warp {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100%;
  width: 100%;
  /* padding: ; */
  background-color: rgba(0, 0, 0, 0.3);
}
.desc-bg {
  height: 100%;
  width: 100%;
  filter: blur(20px);

  background-size: 100%;
  background-position: center;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
}
.headImg img {
  height: 100px;
  width: 100px;
  border-radius: 50%;
  border: 3px solid #fff;
}
.user-desc {
  flex: 1;
  padding: 20px;
  color: white;
  /* position: relative; */
}

.userNamme {
  padding: 20px 0;
  margin-top: 5px;
}
.userFans span {
  margin-right: 20px;
  padding-right: 20px;
}
.rBoder {
  border-right: 1px solid #ccc;
}
/* 编辑按钮 */
.edit {
  position: absolute;
  right: 20px;
  bottom: 20px;
  padding: 10px 20px;
  border: 1px solid #fff;
  cursor: pointer;
}
.edit i {
  margin-right: 5px;
}
</style>